﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Portal.Analytics.UI;
using System.Data;
using System.Data.SqlClient;

namespace SharePoint.Extensions.MOSSAnalytics
{
    public class GetUniqueUsersByDay : SiteReportControl
    {
        protected override string RdlFileName
        {
            get { throw new NotImplementedException(); }
        }

        protected override string StoredProcedureName
        {
            get
            {
                return "dbo.proc_ANL_SiteUniqueUsersByDay";
            }
        }

        public DataTable GetData() 
        {
            return this.LoadReportData();
        }

        protected override string TitleText
        {
            get
            {
                return "GetUniqueUsers";
            }
        }

        protected override Collection<SqlParameter> StoredProcedureParameters
        {
            get
            {
                Collection<SqlParameter> storedProcedureParameters = new Collection<SqlParameter>();
                Guid guid = SPControl.GetContextSite(this.Context).ID;
                storedProcedureParameters.Add(new SqlParameter("@siteGuid", guid));
           
                return storedProcedureParameters;
            }
        }
    }
}
